/*
 * TerrainGrid.h
 *
 *  Created on: Jun 30, 2010
 *      Author: Ry
 */

#ifndef TERRAINGRID_H_
#define TERRAINGRID_H_

#include <GL/glew.h>
#include <world/Object.h>

class TerrainGrid: public Object {
public:

	/**
	 * The VAO for the vertices etc.
	 */
	GLuint g_vao;

	/**
	 * The VBO for the vertices.
	 */
	GLuint vbo_vertices;

	/**
	 * The VBO for the normals.
	 */
	GLuint vbo_normals;

	/**
	 * The VBO for the indices.
	 */
	GLuint vbo_indices;

	GLuint list;

	struct TerrainSquare {
		Object *occupiedBy;
	};

	TerrainGrid(unsigned int rows, unsigned int cols);
	void draw();
	virtual ~TerrainGrid();
private:
	int rows;
	int cols;
	unsigned int size;
	TerrainSquare *squares;
};

#endif /* TERRAINGRID_H_ */
